<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8"/>
  <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  <link rel="stylesheet" type="text/css" href="${ctxPath}/static/sui/semantic.amazon.min.css">
  <script src="${ctxPath}/static/sui/jquery-3.1.1.min.js"></script>
  <script src="${ctxPath}/static/sui/semantic.min.js"></script>
</head>

<body style="min-width:auto;padding:15px">
<div class="ui center">
  <form class="ui form">
    <div class="field">
      <label>本地缓存路径</label>
      <input type="text" id="cache_folder" readonly>
    </div>

    <div class="ui  buttons">
      <button type="button" id="upload_btn" class="ui button primary">保存配置</button>
      <div class="or"></div>
      <button type="button" id="close_btn" class="ui button secondary">取消退出</button>
    </div>
    <div id="msg" style="display: none;" class="ui orange message">模型正在上传,请不要进行任何其他操作.等待完毕</div>


  </form>
</div>
</body>
<script type="text/javascript">
  function set_folder(folder){
    $('#cache_folder').val(folder);
  }
  $(function () {
    $('#cache_folder').click(function () {
      sketchup.cache_folder();
    });
    $('#close_btn').click(function () {
      window.location = 'skp:close_me';
    });
    $('#upload_btn').click(function (e) {
      e.stopPropagation();
      sketchup.config($('#cache_folder').val());
    });
    sketchup.get_cache_folder();
  });

</script>

</html>